#ifndef _VLINE_EDIT_
#define _VLINE_EDIT_


#include <QLineEdit>
#include <QSet>
#include "verrorpromptlabel.h"
class VErrorPromptLabel;
enum class ECHOMODE
{
	LOGIN_ACCOUNT,
	LOGIN_PASSWORD,
	REGIST_ACCOUNT,
	REGIST_PASSWORD,
	REVISE_ACCOUNT,
	REVISE_PASSWORD
};
class VLineEdit  : public QLineEdit
{
	Q_OBJECT
public:signals:
	void formatError(QSet<ERRORTYPE>);
public:
	VLineEdit(QWidget* parent = nullptr);
	~VLineEdit();
	void setMode(ECHOMODE);

private slots:
	void onAccountEditTextChanged(const QString& text);
	void onPasswordEditTextChanged(const QString& text);

private:
	void accountMode();
	void passwordMode();

	void setDefaultStyleSheet();
	void setErrorPromptStyleSheet();

	VErrorPromptLabel* m_pErrorPromptLabel;
};
#endif